- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: OverKeyboardView
with custom ShadowNode
#863
feat: OverKeyboardView
with custom ShadowNode
#863
Conversation
📊 Package size report
|
OverKeyboardView
custom ShadowNode
OverKeyboardView
with custom ShadowNode
3434212
to
7082b59
Compare
This looks amazing! @kirillzyusko When we will have a new version of the package including this? |
@Mako-L I will publish it under 1.17.0, and it may take several weeks (I want to merge some other PRs and then release 1.17.0). In the meantime if you want you can use dependency from a main branch (directly from github). |
@kirillzyusko I just tried the package from main branch and now there is other issue the 'TouchableWithoutFeedback' from example in documentation press doesn't trigger on all the screen it only runs the tap function only on the bottom like around 200px height or something like that. I will open a new ticket and update my repo to reproduce the bug. Thanks again. Edit: |
@Mako-L yeah, I tested example app a lot to be sure that everything works identical to how it worked on paper But let me know if you discover any issues! I'll be happy to fix them before a new release |
@kirillzyusko The problem appears when using KeyboardStickyView with OverKeyboardView. Opened another report: Issue |
📜 Description
Stretch
OverKeyboardView
to full screen height on fabric/android.💡 Motivation and Context
To make
OverKeyboardView
to stretch to full screen we have to override layout on ShadowNodes side. For paper architecture we already do that in correspondingShadowNode
kotlin class. Since new architecture is C++ based - we have to make corresponding changes in C++ code.Unfortunately there is no easy way to add custom properties/code in existing/auto-generated shadow-nodes. To make it working we have to genereate them ourself and change the code accordingly. In this PR I did that. I copied autogenerated code, formatted it according to
cpplint
rules and did a proper linking. After that I wrote additional code that uses values passed from kotlin in c++ and properly resized the inner view.Last, but not least - on iOS we manually specify the size of inner child, on Android - we are laid out by ShadowNodes. To keep the same behavior on Android we need to stretch to full screen width
top: 0, right: 0, bottom: 0, left: 0
, while on iOS we just have to specify exact dimensions.Also on Android/Fabric I discovered, that if view keeps mounted, then the view intercepts touches (even if it's not laid out properly). To fix that and match RN behavior I added
visible && children
condition - in this case we don't mount children and thus they are not clickable 🙃Closes #862
📢 Changelog
Example
JS
architecture.ts
file;interfaceOnly
fromcodegen
;visible=true
(to match Modal behavior);react-native.config.js
;C++
common
folder that contains allShadowNode
s;iOS
common
dependency inPodfile
for new architecture;Android
CMakeList.txt
;detekt
config;StateWrapper
toOverKeyboardView
;stretchTo
function toOverKeyboardView
;🤔 How Has This Been Tested?
Tested locally on Medium Phone API 35 (paper and fabric) and on CI via e2e tests.
📸 Screenshots (if appropriate):
📝 Checklist